home *** CD-ROM | disk | FTP | other *** search
/ 600 Games / 600games.iso / Nave / goobers.swf / scripts / frame_92 / PlaceObject2_76_82 / CLIPACTIONRECORD onClipEvent(load).as < prev   
Encoding:
Text File  |  2007-03-28  |  1.4 KB  |  42 lines

  1. onClipEvent(load){
  2.    function calculate_x(t)
  3.    {
  4.       return this.control_points[0].x * ((1 - t) * (1 - t) * (1 - t) * (1 - t)) + this.control_points[1].x * (2 * t * (1 - t) * (1 - t) * (1 - t)) + this.control_points[2].x * (6 * t * t * (1 - t) * (1 - t)) + this.control_points[3].x * (2 * t * t * t * (1 - t)) + this.control_points[4].x * (t * t * t * t);
  5.    }
  6.    function calculate_y(t)
  7.    {
  8.       return this.control_points[0].y * ((1 - t) * (1 - t) * (1 - t) * (1 - t)) + this.control_points[1].y * (2 * t * (1 - t) * (1 - t) * (1 - t)) + this.control_points[2].y * (6 * t * t * (1 - t) * (1 - t)) + this.control_points[3].y * (2 * t * t * t * (1 - t)) + this.control_points[4].y * (t * t * t * t);
  9.    }
  10.    base_points = new Array();
  11.    var j = 0;
  12.    while(j < 5)
  13.    {
  14.       base_points[j] = new Object();
  15.       j++;
  16.    }
  17.    base_points[0].x = 139.95;
  18.    base_points[0].y = 8;
  19.    base_points[1].x = -146;
  20.    base_points[1].y = 426.95;
  21.    base_points[2].x = 317.95;
  22.    base_points[2].y = 553.95;
  23.    base_points[3].x = 663.95;
  24.    base_points[3].y = 565.95;
  25.    base_points[4].x = 517.95;
  26.    base_points[4].y = -4;
  27.    control_points = new Array();
  28.    var k = 0;
  29.    while(k < 5)
  30.    {
  31.       control_points[k] = new Object();
  32.       control_points[k].x = base_points[k].x;
  33.       control_points[k].y = base_points[k].y;
  34.       k++;
  35.    }
  36.    num_times = 5;
  37.    current_time = 0;
  38.    t = 0;
  39.    inc = 0.01;
  40.    active = false;
  41. }
  42.